package logicgame.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;

public class Nivel2Activity extends Activity {

	private ImageButton comenzar;

	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.nivel2);
		
		Bundle extras = getIntent().getExtras();
		String x = "";
		Log.i("xxxxxx", "antes del if");
		if (extras != null) {
			Log.i("xxxxxx", "dentro del iffffffffffff");
			x = extras.getString("puntu");
		}
		final String a = x;
		Log.i("xxxxxx", a);
		comenzar = (ImageButton) findViewById(R.id.comenzar2);

		comenzar.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				if (a == "") {
					String b = "0";
					Intent i = new Intent(Nivel2Activity.this,Nivel2aActivity.class);
					i.putExtra("puntu", String.valueOf(Integer.parseInt(b)));
					startActivity(i);
				} else {
					Intent i = new Intent(Nivel2Activity.this,Nivel2aActivity.class);
					i.putExtra("puntu", a);
					startActivity(i);
				}
			}
		});
	}
}